﻿/**
* @author	:com.nickro
* @USAGE	:功能性加载的容器，可直接为导出基类
* 
	<code>
		
	</code>
*/

package org.nickro.project.load{
	import flash.display.Loader;
	import flash.display.MovieClip;
	import flash.display.DisplayObjectContainer;
	
	import org.nickro.project.debug.Console;
	import org.nickro.project.events.LoadEvent;
	import org.nickro.project.manager.LoadManager;
	
	public class LoadBox extends MovieClip
	{
		public function LoadBox()
		{
			/**
			 * 可链接到库中的加载元件,基类:org.nickro.project.load.LoadBox,
			 * 所以没有使用静态类 static 以及 保持 构造函数 为空(链接到库的类构造函数不能带参数.)
			 */
		}
		//替换加载
		public function replaceLoad(url:String):void
		{
			var loader:Loader = new Loader();
			LoadManager.getInstance().addLoadBox(loader, url, LoadMode.REPLACE);
		}
		//顺序加载
		public function lineLoad(urls:Array):void
		{
			LoadManager.getInstance().lineLoad(urls);
		}
		
		//过程处理
		private var _progress:Function = null;
		public function get progress():Function { return _progress; };
		public function set progress(value:Function):void { _progress = value; };
		//返回处理
		private var _result:Function = null;
		public function set result(value:Function):void { _result = value; };
		public function get result():Function { return _result; };
		//错误处理
		private var _fault:Function = null;
		public function get fault():Function { return _fault; };
		public function set fault(value:Function):void { _fault = value; };
	}
}